/**      
 * @file		strcpy_s2.cpp
 * @description	This is another example of how to use
 *				strcpy_s().
 *				ONLY WORKS ON WINDOWS!!!!!!
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
#include <string.h> 	// strcpy_s()
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {
	char cString1[] = "Please email my message to the class!";
	char cString2[50];
	int cString1Size = 0;

	// get the size of cString1
	while(cString1[cString1Size] != '\0') cString1Size++;

	cout << "This application demonstrates how to copy cstrings\n";
	cout << "Remember we can't use the assignment operator, = to assign";
	cout << " cstrings values unless we use it when we declare the cstring\n";
	cout << "We'll use strcpy_s(destination, numOfChars, source) to copy cString1 to cString2\n";
	cout << "strcpy_s(cString2, cStringSize, cString1);\n";

	strcpy_s(cString2, cString1Size, cString1);
	cout << "cString1 = " << cString1 << endl;
	cout << "cString2 = " << cString2 << endl;

	return 0;
}

